package com.leff.pvz;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.util.Log;

import com.leff.pvz.scene.GameScene;

public class EngineActivity extends BaseGameActivity implements Constants {

	private static EngineActivity instance = null;
	public static EngineActivity getInstance() {
		return instance;
	}
	
	private GameScene mGameScene;
	
	@Override
	public Engine onLoadEngine() {

		return new Engine(new EngineOptions(true, 
				ScreenOrientation.LANDSCAPE,
				new RatioResolutionPolicy(SCENE_WIDTH, SCENE_HEIGHT),		// <-- This stretches the canvas. Check scaleScenes() for the correction
				new Camera(0, 0, SCENE_WIDTH, SCENE_HEIGHT)
				).setNeedsMusic(true).setNeedsSound(true)
			);
	}
	@Override
	public void onLoadResources() {

		ResourceLibrary RL = ResourceLibrary.getInstance();
		
		Log.v(TAG, "FUUUUUCK");
		RL.initialize(mEngine, this);
		
		mGameScene = GameScene.getInstance();
	}
	@Override
	public Scene onLoadScene() {
		
		
		
		return mGameScene;
	}
	
	@Override
	public void onLoadComplete() {
	}
}
